package com.dev1.pack01web.Controller;

import com.dev1.pack01web.bean.Province;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@Controller
@RestController
public class TestJsonController {
    @GetMapping("/provinces")
    @ResponseBody
    public List<Province> getProvinces(){
        List<Province> list  = new ArrayList<>();
        list.add(new Province("黑龙江",10));
        list.add(new Province("湖南",6));
        list.add(new Province("湖北",7));
        return list;
    }
}
